Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: return RangeIndex from difference, symmetric_difference #36564

Merged
merged 7 commits into from
Oct 7, 2020

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Sep 23, 2020

@jbrockmendel
Copy link
Member Author

@iamlemec can you take a look and tell me what needs to be done here to be consistent with what you're doing in #36413?

@iamlemec
Copy link
Contributor

@iamlemec can you take a look and tell me what needs to be done here to be consistent with what you're doing in #36413?

I think the most consistent way here would be to use _wrap_setop_result on the final return statement and _get_reconciled_name_object on the quick return statements up top. I actually didn't really touch difference and symmetric_difference in #36413, but it would make sense that they get a similar treatment.

My only concern regarding difference is that maybe since it's not a symmetric operation, it's naming rule should be left-biased. Like, if you're just dropping a few nameless elements, should that clobber the original name?

@jreback jreback added this to the 1.2 milestone Sep 24, 2020
@jreback jreback added the Index Related to the Index class or subclasses label Sep 24, 2020
@jbrockmendel
Copy link
Member Author

added name checks to tests

@jreback
Copy link
Contributor

jreback commented Oct 2, 2020

i guess this is technically a change, can you add a note; ping on green.

@jbrockmendel
Copy link
Member Author

ping

@jreback jreback merged commit 4f674a1 into pandas-dev:master Oct 7, 2020
@jbrockmendel jbrockmendel deleted the enh-rng-difference branch October 7, 2020 03:32
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Return RangeIndex for .difference and .symmetric_difference
3 participants